from rest_framework import serializers

from apps.goods.models import GoodsVisitCount


class GoodsVisitCountSerializer(serializers.ModelSerializer):

    category  = serializers.StringRelatedField()
    category_id = serializers.IntegerField()

    class Meta:
        model = GoodsVisitCount
        fields = ['category', 'date', 'count', 'category_id']